<?php
/**
 * Point detail
 * แสดงรายละเอียดแต้ม member
 * @package Member
 * @subpackage View
 * @category view
 */
require('right_bar.php');
$x['AddTitle'] .= $this->lang->line('member.142.memberpoint');

/* Load CSS */
$tmp = array('a:c:validationEngine.jquery', 'a:c:form_signup', 'a:c:excite-bike:jqui187', 'a:c:table-style','a:c:fancybox134');
$x['AddHead'] .= $this->bee->AddCss($tmp);
unset($tmp);
// Load CSS
/* Load JavaScript*/
  $tmp = array('a:j:jquery.validationEngine-en', 'a:j:jquery.validationEngine','a:j:fancybox134.pack','a:j:jqui187.core','a:j:jqui187.widget');
  $bf['AddFoot'] .= $this->bee->AddJava($tmp);
  unset($tmp);
  // Load JavaScript 

$x['AddCss'] .= '';
$bf['AddHeadJquery'] .= '
    $(".form_blue").validationEngine();
    $(".bbox").fancybox();
    $( "#tabs" ).tabs();
    $("#ajaxclick a").live("click",function(){
        var href = $(this).attr("href");
        $(this).attr("href","#ui-tabs-1");
        $("#ui-tabs-1").load(href);
    });
    $("#ajaxclickkarma a").live("click",function(){
        var href = $(this).attr("href");
        $(this).attr("href","#ui-tabs-2");
        $("#ui-tabs-2").load(href);
    });
    ';

$x['headlink'] = $this->lang->line('member.142.memberpoint');

$this->admin->view('_head', $x);
unset($x);
?>
<div id="rightnow">
    <h3 class="reallynow">
        <span><?php echo $this->lang->line("member.142.memberpoint"); ?></span>
        <?php
        echo '<a href="#takepoint" class="bsp bicon s-calculator bbox">'.$this->lang->line('member.143.addpoint').'</a>';
        echo '<a href="#takekarma" class="bsp bicon s-calculator bbox">'.$this->lang->line('member.145.addkarma').'</a>';
        ?>
        <br />
    </h3>

</div>
<table class="btable">
    <tbody>
         <tr>
            <th><?php echo $this->lang->line('mem.60.id'); ?></th>
            <td><?php echo $member->user_id?></td>
            <th><?php echo $this->lang->line('mem.61.user'); ?></th>
            <td><?php echo $member->username?></td>
         </tr>
   
        <tr>
            <th><?php echo $this->lang->line('mem.62.email'); ?></th>
            <td><?php echo $member->email?></td>
            <th><?php echo $this->lang->line('mem.89.modified'); ?></th>
            <td><?php echo $member->modified?></td>
        </tr>

        <tr>
            <th><?php echo $this->lang->line('mem.64.active'); ?></th>
            <td><?php echo $member->activated?>
            <?php
            if(!$member->activated){
                echo anchor('member/admin/activate_user/'.$member->user_id,$this->lang->line('mem.92.activate'),'class="bsp bicon s-tick"');
            }
            ?></td>
<th><?php echo $this->lang->line('mem.86.last_ip'); ?></th>
            <td><?php echo $member->last_ip?></td>
        </tr>

        <tr>
            <th><?php echo $this->lang->line('mem.87.last_login'); ?></th>
            <td><?php echo $member->last_login?></td>
            <th><?php echo $this->lang->line('mem.88.created'); ?></th>
            <td><?php echo $member->created?></td>
        </tr>

        <tr>
            <th><?php echo $this->lang->line('member.142.memberpoint'); ?></th>
            <td><?php echo $member_score['score']?></td>
            <th><?php echo $this->lang->line('member.146.lastupdate'); ?></th>
            <td><?php echo $member_score['lastupdate']?></td>
        </tr>

        <tr>
            <th><?php echo $this->lang->line('member.147.karma'); ?></th>
            <td><?php echo $member_karma['score']?></td>
            <th><?php echo $this->lang->line('member.146.lastupdate'); ?></th>
            <td><?php echo $member_karma['lastupdate']?></td>
        </tr>


        </tbody>

</table>
<div id="tabs">
	<ul>
		<li><a href="#tabs-1"><?php echo $this->lang->line('member.148.lastactivity'); ?></a></li>
		<li><?php echo anchor('member/admin/load_point/'.$member->user_id.'/score/',$this->lang->line('member.149.viewallscore'));?></li>
                <?php if(isset($member_log_karma['1']['score'])):?>
		<li><a href="#tabs-3"><?php echo $this->lang->line('member.148.lastkarma'); ?></a></li>
                <li><?php echo anchor('member/admin/load_point/'.$member->user_id.'/karma/',$this->lang->line('member.150.viewallkarma'));?></li>
                <?php endif;?>
	</ul>
	<div id="tabs-1">
            <table class="btable">
                <tr>
                    <th><?php echo $this->lang->line('member.144.point'); ?></th>
                    <th><?php echo $this->lang->line('member.144.reason'); ?></th>
                    <th><?php echo $this->lang->line('member.146.lastupdate'); ?></th>
                </tr>
                    <?php
                    if(is_array($member_log_point)){
                        foreach($member_log_point as $k){
                            ?>
                <tr>
                    <td><?php echo $k['score']?></td>
                    <td><?php echo $k['reason']?></td>
                    <td><?php echo $k['createdate']?></td>
                </tr>
                            <?php
                        }
                    }
                    ?>
                    
                
            </table>
	</div>
	<div id="tabs-2">
		
	</div>
        <?php if(isset($member_log_karma['1']['score'])):?>
	<div id="tabs-3">
		<table class="btable">
                <tr>
                    <th><?php echo $this->lang->line('member.144.point'); ?></th>
                    <th><?php echo $this->lang->line('member.144.reason'); ?></th>
                    <th><?php echo $this->lang->line('member.146.lastupdate'); ?></th>
                </tr>
                    <?php
                    if(is_array($member_log_karma)){
                        foreach($member_log_karma as $k){
                            ?>
                <tr>
                    <td><?php echo $k['score']?></td>
                    <td><?php echo $k['reason']?></td>
                    <td><?php echo $k['createdate']?></td>
                </tr>
                            <?php
                        }
                    }
                    ?>


            </table>
	</div>
        <div id="tabs-4">

	</div>
        <?php endif;?>
</div>

<div style="display:none;">
<div id="takepoint">
    <form action="<?php echo site_url('member/admin/take_score/'.$member->id.'/point')?>" method="post" class="form_blue" target="_top">
        <fieldset>
            <legend><?php echo $this->lang->line('member.143.addpoint');?></legend>
            <div><label for="point"><?php echo $this->lang->line('member.144.point');?></label>
            <input type="text" name="point" id="point" class="validate[required,length[2,4]]" /><?php echo $this->lang->line('member.144.adddetail');?>
            </div>
            <div>
            <label for="reason"><?php echo $this->lang->line('member.144.reason');?></label>
            <input type="text" name="reason" id="reason" class="validate[required,length[3,254]]" />
            </div>
            <input type="submit" name="submit" value="submit" />
        </fieldset>
    </form>
</div>
    <div id="takekarma">
    <form action="<?php echo site_url('member/admin/take_score/'.$member->id.'/karma')?>" method="post" class="form_blue" target="_top">
        <fieldset>
            <legend><?php echo $this->lang->line('member.145.addkarma');?></legend>
            <div><label for="point"><?php echo $this->lang->line('member.144.point');?></label>
            <input type="text" name="point" id="point" class="validate[required,length[2,4]]" /><?php echo $this->lang->line('member.144.adddetail');?>
            </div>
            <div>
            <label for="reason"><?php echo $this->lang->line('member.144.reason');?></label>
            <input type="text" name="reason" id="reason" class="validate[required,length[3,254]]" />
            </div>
            <input type="submit" name="submit" value="submit" />
        </fieldset>
    </form>
</div>
    </div>
<?php
        $this->admin->view('_foot', $bf);
        unset($bf);
?>